import { Global, Module } from "@nestjs/common";
import { PrismaClient } from "@prisma/client";

declare class BigInt {
  toJSON(): string;
}

BigInt.prototype.toJSON = function () {
  return this.toString();
};

const prismaProvider = {
  provide: PrismaClient,
  useValue: new PrismaClient({
    // log: ["query", "info", "warn", "error"],
  }),
};
@Global()
@Module({
  providers: [prismaProvider],
  exports: [prismaProvider],
})
export class PrismaModule {}
